<template>
  <div>
    <Dog v-for="(item,index) in list" 
    :key="index"
    :Url="item.dogImgUrl"
    :uname="item.dogName"
    @dog="addFn"
    ></Dog>
    <p >你喜欢的够如下:<span v-for="(ite,ind) in add" :key="ind">{{ite}}</span></p>
    
  </div>
</template>

<script>
import Dog from "./components/Dog";
export default {
  data() {
    return {
      add:[],
      list: [
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "博美",
        },
        {
          dogImgUrl:
            "https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c",
          dogName: "泰迪",
        },
        {
          dogImgUrl:
            "https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c",
          dogName: "金毛",
        },
        {
          dogImgUrl:
            "https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c",
          dogName: "哈士奇",
        },
        {
          dogImgUrl:
            "https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c",
          dogName: "阿拉斯加",
        },
        {
          dogImgUrl:
            "https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c",
          dogName: "萨摩耶",
        },
      ],
    };
  },
  components: {
    Dog
  },
  methods:{
    addFn(name) {
      // console.log(this.add);
      this.add.push(name)
    }
  }
};
</script>

<style>
</style>